<include file="Public/min-header"/>

<div class="wrapper">
    <include file="Public/breadcrumb"/>
	<section class="content">
       <div class="row">
       		<div class="col-xs-12">
	       		<div class="box"> 
	           	<div class="box-header">
	               <nav class="navbar navbar-default">
				        <div class="collapse navbar-collapse">
				          <form class="navbar-form form-inline" action="/Admin/Promotion/join_goods_list?status={:I('status')}" method="post">
				            <div class="form-group">
				              	<input type="text" name="keywords" class="form-control" value="{:I('keywords')}" placeholder="搜索">
								<input type="hidden" name="status" class="form-control" value="{:I('status')}">
				            </div>
				            <button type="submit" class="btn btn-default">提交</button>
				            <div class="form-group pull-right">
					            <!-- <a href="{:U('Promotion/join_goods_info')}" class="btn btn-primary pull-right"><i class="fa fa-plus"></i>我要报名</a> -->
								<span style="color:red"><b>同个产品同时</b> 只能参加一个活动，如出现 <b>同个产品同时</b> 参加多个活动，以最后报名的活动为主。</span>
				            </div>
				          </form>
				      	</div>
	    			</nav>
	             </div>	    
	             <!-- /.box-header -->
	             <div class="box-body">
	           		<div class="row">
	            	<div class="col-sm-12">
		              <table id="list-table" class="table table-bordered table-striped dataTable">
		                 <thead>
		                   <tr role="row">
							   <th class="sorting" tabindex="0" style="text-align: center;">店铺名</th>
			                   <th class="sorting" tabindex="0" style="text-align: center;">活动类型</th>
			                   <th class="sorting" tabindex="0" style="text-align: center;">折扣率%</th>
							   <th class="sorting" tabindex="0" style="text-align: center;">满送内容</th>
							   <th class="sorting" tabindex="0" style="text-align: center;">限购数</th>
							   <th class="sorting" tabindex="0" style="text-align: center;">活动说明</th>
			                   <th style="text-align: center;">审核状态</th>
			                   <th class="sorting" tabindex="0" style="text-align: center;">操作</th>
		                   </tr>
		                 </thead>
						<tbody>
						  <foreach name="prom_list" item="vo" key="k" >
						  	<tr role="row" align="center">
							<td>{$vo[store_name]}</td>
		                     <td>{$parse_type[$vo[prom_type]]}</td>
		                     <td style="color: green;">{$vo.expression}</td>
							 <td style="color: green;">{$vo.mansong}</td>
							 <td style="color: red;">{$vo.xiangou}件</td>
		                     <td>{$vo.content}</td>
							 <td><img width="20" height="20" src="__PUBLIC__/images/<if condition='$vo[status] eq 1'>yes.png<else />cancel.png</if>" onclick="changeTableVal('goods_join','id','{$vo.id}','status',this)"/></td>
							 <td>
		                      <a href="javascript:;" data-url="{:U('Promotion/join_get_goods',array('id'=>$vo['id']))}" data-toggle="tooltip" title="" class="btn btn-info goods_list">活动产品</a>
		                      <a class="btn btn-primary" href="{:U('Promotion/join_goods_info',array('id'=>$vo['id']))}"><i class="fa fa-pencil"></i></a>
							  <?php
							  if($vo['status']==0){
							  ?>
		                      <a class="btn btn-danger" href="{:U('Promotion/join_goods_del',array('id'=>$vo['id']))}" data-url=" " data-id="{$vo.id}" ><i class="fa fa-trash-o"></i></a>
							  <?php
							  }
							  ?>
							</td>
		                   </tr>
		                  </foreach>
		                   </tbody>
		               </table>
	               </div>
	          </div>
              <div class="row">
              	    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$page}</div>
              </div>
	          </div><!-- /.box-body -->
	        </div><!-- /.box -->
       	</div>
       </div>
   </section>
</div>
<script>
$('.goods_list').click(function(){
    var url = $(this).attr('data-url');
    layer.open({
        type: 2,
        title: '活动关联商品列表',
        shadeClose: true,
        shade: 0.5,
        area: ['70%', '72%'],
        content: url, 
    });
});
</script>
</body>
</html>